package com.zwps.biz.controller.http;

import com.zwps.biz.api.model.vo.fourpipes.PubCommonVO;
import com.zwps.biz.api.model.vo.fourpipes.TrainNewVO;
import com.zwps.biz.api.model.vo.structure.ZEquityStruVO;
import com.zwps.biz.api.model.vo.structure.ZManageProtectStruVO;
import com.zwps.biz.dal.db.object.TInstitutionDO;
import com.zwps.biz.domain.service.*;
import com.zwps.common.controller.response.message.ResponseDataMessage;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Tag(name = "四制（治）")
@RestController
@RequestMapping("structure/governance")
@Validated
public class TInstitutionController {
    @Autowired
    private TInstitutionService institutionService;
    @Autowired
    private ZEquityService zEquityService;
    @Autowired
    private ZManageProtectService zManageProtectService;
    @Autowired
    ZTrainRecordService zTrainRecordService;

    @Autowired
    VillageLandInfoService villageLandInfoService;

    @Operation(summary = "查询管理主题与责任")
    @GetMapping("getDate")
    public TInstitutionDO getDate() {
        //获取运营主题信息内容
       return institutionService.getoperatEntity();

    }

    @Operation(summary = "查询产权项目信息")
    @GetMapping("getEquity")
    public ZEquityStruVO getEquity() {
        return  zEquityService.getEquity();
    }

    @Operation(summary = "查询管养分离合同")
        @GetMapping("getManageProtect")
    public ResponseDataMessage getManageProtect() {
        return  ResponseDataMessage.data(zManageProtectService.getManageProtect());
    }

    /**
     * 培训计划与记录
     */
    @GetMapping("getTrainRecordByType")
    public TrainNewVO getTrainRecordByType(@RequestParam(value = "year", required = false) String year,
                                           @RequestParam(value = "type", required = false) String type) {
        return zTrainRecordService.getTrainRecordByType(year, type);
    }

    /**
     * 标准化管理手册
     *
     * @return
     */
    @GetMapping("getFiles")
    public ResponseDataMessage getFileByTypes() {
        return ResponseDataMessage.data(villageLandInfoService.getFileByTypes());
    }

}
